<template>
  <!--  <basic-container>-->
  <div class="aaa">

    <!--    <el-button type="text" @click="tableTo('表单')">表单</el-button>-->
    <!--&lt;!&ndash;    <el-button type="primary" @click="log()">buttonCont</el-button>&ndash;&gt;-->
    <!--&lt;!&ndash;    &lt;!&ndash;    <el-tree :data="menu" :props="defaultProps" @node-click="spanTo(data)" node-key="menu.id"></el-tree>&ndash;&gt;&ndash;&gt;-->
    <!--&lt;!&ndash;    <div class="ccc">&ndash;&gt;-->
    <!--&lt;!&ndash;      <div @click="spanTo(items)" v-for="(items,index) in  menu" :key="index">&ndash;&gt;-->
    <!--&lt;!&ndash;        <span v-for="(item,index) in items.children" :key="index">{{ item.studentName }}</span>&ndash;&gt;-->
    <!--&lt;!&ndash;      </div>&ndash;&gt;-->

    <!--&lt;!&ndash;    </div>&ndash;&gt;-->
    <!--&lt;!&ndash;    <div v-if="menu.length===0">&ndash;&gt;-->
    <!--&lt;!&ndash;      <span> 暂无数据</span>&ndash;&gt;-->

    <!--&lt;!&ndash;    </div>&ndash;&gt;-->
    <!--    <el-button type="primary" @click="getSelectWeek()">-->
    <!--      <i class=" el-icon-circle-plus-outline" style="font-size: 14px; color: #F3B815"></i>-->
    <!--      buttonCont-->
    <!--    </el-button>-->
    <!--    <index></index>-->
    <!--    <div :style="stylelist" style="width: 100px;height: 100px;background: #0a64b1 "></div>-->
    <!--    <el-button type="primary" @click="log()">buttonCont</el-button>-->
    <!--    <img :src="require('@/assets'+imlist)" alt="">-->
    <!--    <div>-->
    <!--      <el-table-->
    <!--        :data="dataList"-->
    <!--        :span-method="mergeData"-->
    <!--        border-->
    <!--        style="width: 100%; margin-top: 20px">-->
    <!--        <el-table-column-->
    <!--          prop="id"-->
    <!--          label="ID"-->
    <!--          width="180">-->
    <!--        </el-table-column>-->
    <!--        <el-table-column-->
    <!--          prop="studentName"-->
    <!--          label="姓名">-->
    <!--        </el-table-column>-->
    <!--        <el-table-column-->
    <!--          prop="amount1"-->
    <!--          label="数值 1（元）">-->
    <!--        </el-table-column>-->
    <!--        <el-table-column-->
    <!--          prop="amount2"-->
    <!--          label="数值 2（元）">-->
    <!--        </el-table-column>-->
    <!--        <el-table-column-->
    <!--          prop="amount3"-->
    <!--          label="数值 3（元）">-->
    <!--        </el-table-column>-->
    <!--      </el-table>-->
    <!--    </div>-->
    <!--
    @dataList 数据
     @colDataList 头部信息
     @config 合并配置项
    -->
    <!--    <el-button @click="showYprDialClick('1')">aa</el-button>-->
    <!--    <showYprDialog :dialogTitle="dialogTitle" :showYprDialog='showYprDialog' @showYprDialClick="showYprDialClick"-->
    <!--                   @renew="renew"></showYprDialog>-->
    <!--    <el-button   @click="print">打印</el-button>-->

    <!--    <el-button v-print="'#printTest'" @click="showJsBarcode">打印</el-button>-->
    <!--    <barcode  ref="barcode" v-if="barcodeData.length" :barcodeData="barcodeData"></barcode>-->
    <button @click="sendJsonp()">send</button>
  </div>
</template>
<script src="111.js"></script>
<script>

import {mapGetters} from "vuex";

// import index from '../teacher/home/teIndex'
import {getSelectWeek} from "@/api/system/demo";
import barcode from "@/views/comonents/barcode";

export default {
  components: {
    barcode
  },
  data() {
    return {
      barcodeData: [],
      showYprDialog: '',
      dialogTitle: 'aaa',
      code: '111',
      showYprDia: false,
      tableData: [
        {
          studentName: "111",
          studentCode: '11111111111',
          specialtyClassName: '2021级信息珍收传输专科班专科班'
        },
        {
          studentName: "111",
          studentCode: '11111111111',
          specialtyClassName: '2021级信息珍收传输专科班专科班'
        },
        {
          studentName: "111",
          studentCode: '11111111111',
          specialtyClassName: '2021级信息珍收传输专科班专科班'
        },
        {
          studentName: "111",
          studentCode: '11123345368976',
          specialtyClassName: '2021级信息珍收传输专科班专科班'
        }, {
          studentName: "111",
          studentCode: '11123345368976',
          specialtyClassName: '2021级信息珍收传输专科班专科班'
        },

      ]
    }

  },
  mounted() {
    // this.newMenu(this.menu)
  },
  methods: {
    sendJsonp: function ()  {
      console.log('aa')
      $.ajax({
        type: "get",    //请求方式
        async: true,    //是否异步
        url: "http://192.168.1.101:8080/rebuy/1/1",
        dataType: "jsonp",    //跨域json请求一定是jsonp
        jsonp: "callbackparam",    //跨域请求的参数名，默认是callback
        //jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
        data: {"query": ""},    //请求参数

        beforeSend: function () {
          //请求前的处理
        },

        success: function (data) {
          //请求成功处理，和本地回调完全一样
        },

        complete: function () {
          //请求完成的处理
        },

        error: function () {
          //请求出错处理
        }
      });
    },
    showJsBarcode: function () {
      console.log(this.$refs)
      // this.$refs.barcode.handleParentClick("ssss");
      // this.barcodeData = this.tableData
      // console.log(this.barcodeData)
    },
    renew: function (val) {
      console.log('renew', val)
    },
    getSelectWeek: function () {
      return new Promise(() => {
        getSelectWeek().then(res => {
          console.log(res, 'res')
        })
      })
    },

    tableTo: function (e) {
      switch (e) {
        case '表单':
          this.$router.push({path: '/student/home'})
          break;
      }
    },
    spanTo: function (item) {
      console.log(item)
      if (item.children) {
        this.$router.push({path: item.children[0].path})
      } else {
        this.$router.push({path: item.path})
      }
    },
    // newMenu: function (item) {
    //   if (item[0].hasChildren) {
    //     this.newMenulist = this.menu[0].children;
    //   }
    // },
    log: function () {
      // console.log(this.nowTagValue, 'nowTagValue')
      // console.log(this.website, 'website')
      // console.log(this.menuAll[0].children[1], 'this.imlistd')
      console.log(this.menuAll[0].children)
      this.stylelist = this.menuAll[0].children[1].studentCode

      this.stylelist = this.stylelist.replace(new RegExp('\\"', "gm"), '"');
      console.log(this.stylelist, 'this.stylelist')
      // console.log(this.tag, 'tag')
      // console.log(this.keyCollapse, 'keyCollapse')
      // console.log(this.screen, 'screen')
      // console.log(this.menuId, 'menuId')
    },
  }
  ,
  computed: {
    ...mapGetters(['menuAll', 'comonents']),

  }
}
</script>


